#include "ChessProcessor.h"
#include "preprocess.h"
#include "chessdatabase.h"
#include "FeatureExtractor.h"

int main() {
    // 设置根目录路径（根据你的实际路径修改）
   // std::string rootDirectory = "/mnt/hgfs/aic_jeff/final_project/3.棋局获取显示/3.1棋子检测识别/棋子素材";
    // 开始处理所有棋子
   // processChessPieces(rootDirectory);
   
   std::string testImagePath = "/mnt/hgfs/aic_jeff/final_project/3.棋局获取显示/3.1棋子检测识别/Project1/Project1/黑马.jpg"; 
    testChessRecognition(testImagePath);
	/*
	ChessDatabase db("test.db");
	cv::Mat croppedImage;
	
	try {
        ImageProcessor processor("/mnt/hgfs/aic_jeff/final_project/3.棋局获取显示/3.1棋子检测识别/Project1/Project1/黑车.png");
        
        if (processor.processImage()) {
            cv::imshow("原始图像", processor.getResultImage());
            cv::imshow("裁剪结果", processor.getCroppedImage());
			croppedImage=processor.getCroppedImage();
            cv::waitKey(0);
        }
    } catch (const std::exception& e) {
        std::cerr << "错误: " << e.what() << std::endl;
        //return -1;
    }
	ChessDatabase::ChessPiece piece=extractChessPieceFeatures(
	croppedImage,
	1,
	2,
	"pawn"
	);
	db.addChessPiece(piece);
  */
   
    return 0;
}